{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "cpp"
    }
   },
   "outputs": [],
   "source": [
    "template <typename T>\n",
    "inline void readi(T &x)\n",
    "{\n",
    "    T f = 1;\n",
    "    x = 0;\n",
    "    int ch;\n",
    "    while (ch = getchar(), !feof(stdin) && !isdigit(ch) && ch != '-')\n",
    "        ;\n",
    "    if (ch == '-')\n",
    "        f = -f, ch = getchar();\n",
    "    while (!feof(stdin) && isdigit(ch)) {\n",
    "        x = (x << 3) + (x << 1) + ch - 0x30;\n",
    "        ch = getchar();\n",
    "    }\n",
    "    x *= f;\n",
    "}\n",
    "inline void readl() {}\n",
    "template <typename T, typename... Args>\n",
    "inline void readl(T &x, Args &...args)\n",
    "{\n",
    "    readi(x);\n",
    "    readl(args...);\n",
    "}\n",
    "template <typename T>\n",
    "inline void writei(T x)\n",
    "{\n",
    "    if (x == 0) {\n",
    "        putchar('0');\n",
    "        return;\n",
    "    }\n",
    "    if (x < 0)\n",
    "        x = -x, putchar('-');\n",
    "    T p = 1;\n",
    "    while (x / p >= 10)\n",
    "        p = (p << 3) + (p << 1);\n",
    "    while (p) {\n",
    "        putchar(x / p + 0x30);\n",
    "        x %= p;\n",
    "        p /= 10;\n",
    "    }\n",
    "}\n",
    "inline void writel() {}\n",
    "template <typename T, typename... Args>\n",
    "inline void writel(T x, Args... args)\n",
    "{\n",
    "    writei(x);\n",
    "    putchar(\" \\n\"[sizeof...(args) == 0]);\n",
    "    writel(args...);\n",
    "}"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
